﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;

namespace NSATBPortal
{
    public partial class MachineGroupHome : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void DefMachineGroupGrid_RowEditing(object sender, GridViewEditEventArgs e)
        {
            int iIndex = e.NewEditIndex;

            string sRecID = DefMachineGroupGrid.DataKeys[iIndex].Value.ToString();
            string sRecName = DefMachineGroupGrid.Rows[iIndex].Cells[2].Text;

            Response.Redirect("MachineGroupEditAssignments.aspx?ID=" + sRecID.Trim() + "&Name=" + Server.UrlEncode(sRecName));
        }

        protected void DefMachineGroupGrid_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int iIndex = e.RowIndex;
            string sRecID = DefMachineGroupGrid.DataKeys[iIndex].Value.ToString();
        }

        protected void DefMachineGroupGrid_Init(object sender, EventArgs e)
        {
            DataTable dtResults;
            using (ATBSchemaDB objATBDB = new ATBSchemaDB())
            {
                dtResults = objATBDB.GetTestMachineGroupList();
            }

            DefMachineGroupGrid.DataSource = dtResults;
            DefMachineGroupGrid.DataBind();
        }
    }
}